package com.allqj.qjf.config;

import com.allqj.qjf.service.CommonDict;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;

/**
 * @author sjw
 * @className DictAutoConfiguration
 * @date 2021/8/22 10:38
 * @description: TODO
 */
@Configuration
@ConditionalOnClass(CommonDict.class)
@EnableConfigurationProperties(DictServiceProperties.class)
@ConditionalOnProperty(prefix = "common-dict", value = {"serviceUrl", "enableCache"})
@ComponentScan(basePackages = "com.allqj.qjf")
public class DictAutoConfiguration {
    public DictAutoConfiguration(DictServiceProperties dictServiceProperties){
        CommonDict.init(dictServiceProperties);
    }
}
